import java.util.Calendar;
import java.util.Scanner;
//5:6月的第3个星期日是父亲节，由用户输入年份，算出该年的父亲节是哪一天
public class Work {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        System.out.println("请输入年份");
        int year = in.nextInt();
        Calendar a = Calendar.getInstance();
        a.set(year, 5 - 1, 31);
        int count = 0;
        for (int i = 0; i < 30; i++) {
            a.add(Calendar.DAY_OF_MONTH, 1);
            if (a.get(Calendar.DAY_OF_WEEK) == 1) {
                count++;
                if (count == 3) {
                    System.out.println(year + "年的父亲节是" + (a.get(Calendar.MONTH) + 1) + "月" + a.get(Calendar.DATE) + "日");
                }
            }
        }
    }
}